package com.cq.hd.member.controller;

import com.alibaba.fastjson.JSONObject;
import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.common.response.ResultGenerator;
import com.cq.hd.member.api.TbBankPayRecordApi;
import com.cq.hd.member.api.dto.AdminBankPayRecordPageDto;
import com.cq.hd.member.api.dto.BankPayQueryDto;
import com.cq.hd.member.api.dto.BankPayRechargeDto;
import com.cq.hd.member.api.vo.AdminBankPayRecordPageVo;
import com.cq.hd.member.api.vo.BankPayQueryVo;
import com.cq.hd.member.api.vo.BankPayRechargeVo;
import com.cq.hd.member.service.TbBankPayRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 网银支付记录表 前端控制器
 * </p>
 *
 * @author mYunYu
 * @since 2024-02-21
 */
@RestController
public class TbBankPayRecordController implements TbBankPayRecordApi {

    @Autowired
    private TbBankPayRecordService bankPayRecordService;

    @Override
    public Result<BankPayRechargeVo> recharge(@RequestBody BankPayRechargeDto bankPayRechargeDto) {
        return ResultGenerator.success(bankPayRecordService.recharge(bankPayRechargeDto));
    }

    @Override
    public Result<BankPayQueryVo> queryOrderPay(@RequestBody BankPayQueryDto bankPayQueryDto) {
        return ResultGenerator.success(bankPayRecordService.queryOrderPay(bankPayQueryDto));
    }

    @Override
    public Result<Page<AdminBankPayRecordPageVo>> pageAdminBankPayRecord(AdminBankPayRecordPageDto adminBankPayRecordPageDto) {
        return ResultGenerator.success(bankPayRecordService.pageAdminBankPayRecord(adminBankPayRecordPageDto));
    }

    @Override
    public Result<Boolean> bankPayCallback(@RequestBody JSONObject dataObj) {
        return ResultGenerator.success(bankPayRecordService.bankPayCallback(dataObj));
    }
}
